/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.minam.beans;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alvaro
 */
@Entity
@Table(name = "SCAMVD_ESTACION")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ScamvdEstacion.findAll", query = "SELECT s FROM ScamvdEstacion s"),
    @NamedQuery(name = "ScamvdEstacion.findByIdEsta", query = "SELECT s FROM ScamvdEstacion s WHERE s.scamvdEstacionPK.idEsta = :idEsta"),
    @NamedQuery(name = "ScamvdEstacion.findByIdFoto", query = "SELECT s FROM ScamvdEstacion s WHERE s.scamvdEstacionPK.idFoto = :idFoto"),
    @NamedQuery(name = "ScamvdEstacion.findByDFechaReg", query = "SELECT s FROM ScamvdEstacion s WHERE s.dFechaReg = :dFechaReg"),
    @NamedQuery(name = "ScamvdEstacion.findByVDetalle", query = "SELECT s FROM ScamvdEstacion s WHERE s.vDetalle = :vDetalle"),
    @NamedQuery(name = "ScamvdEstacion.findByIdUser", query = "SELECT s FROM ScamvdEstacion s WHERE s.idUser = :idUser")})
public class ScamvdEstacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ScamvdEstacionPK scamvdEstacionPK;
    @Lob
    @Column(name = "B_FOTO")
    private Serializable bFoto;
    @Column(name = "D_FECHA_REG")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dFechaReg;
    @Size(max = 500)
    @Column(name = "V_DETALLE")
    private String vDetalle;
    @Column(name = "ID_USER")
    private BigInteger idUser;

    public ScamvdEstacion() {
    }

    public ScamvdEstacion(ScamvdEstacionPK scamvdEstacionPK) {
        this.scamvdEstacionPK = scamvdEstacionPK;
    }

    public ScamvdEstacion(BigInteger idEsta, BigInteger idFoto) {
        this.scamvdEstacionPK = new ScamvdEstacionPK(idEsta, idFoto);
    }

    public ScamvdEstacionPK getScamvdEstacionPK() {
        return scamvdEstacionPK;
    }

    public void setScamvdEstacionPK(ScamvdEstacionPK scamvdEstacionPK) {
        this.scamvdEstacionPK = scamvdEstacionPK;
    }

    public Serializable getBFoto() {
        return bFoto;
    }

    public void setBFoto(Serializable bFoto) {
        this.bFoto = bFoto;
    }

    public Date getDFechaReg() {
        return dFechaReg;
    }

    public void setDFechaReg(Date dFechaReg) {
        this.dFechaReg = dFechaReg;
    }

    public String getVDetalle() {
        return vDetalle;
    }

    public void setVDetalle(String vDetalle) {
        this.vDetalle = vDetalle;
    }

    public BigInteger getIdUser() {
        return idUser;
    }

    public void setIdUser(BigInteger idUser) {
        this.idUser = idUser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scamvdEstacionPK != null ? scamvdEstacionPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ScamvdEstacion)) {
            return false;
        }
        ScamvdEstacion other = (ScamvdEstacion) object;
        if ((this.scamvdEstacionPK == null && other.scamvdEstacionPK != null) || (this.scamvdEstacionPK != null && !this.scamvdEstacionPK.equals(other.scamvdEstacionPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.com.minam.beans.ScamvdEstacion[ scamvdEstacionPK=" + scamvdEstacionPK + " ]";
    }
    
}
